package com.monkeys.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author KuangTeam
 */
@Mapper
public interface GoodsMapper {

    //返回所有类型非工厂的poi的id
    @Select("SELECT id FROM pois WHERE type != '工厂'")
    List<Integer> getOwners();

    //返回所有工厂的id
    @Select("SELECT id FROM pois WHERE type = '工厂'")
    List<Integer> getSenders();

    //返回所有货物的ids
    @Select("SELECT id FROM goods")
    List<Integer> getGoods();

    //根据id获得type
    @Select("select type_name from goods where id = #{goodsId} ")
    String getTypeById(Integer goodsId);
}
